#!/bin/bash

echo "Start h5ai..."

if [ ! -d /data/h5ai ]; then
    sudo mkdir -p /data/h5ai
    sudo chown -R $USER. /data/h5ai
fi

docker run -d --name=h5ai \
	-p 9080:80 \
	-v /data/h5ai:/h5ai \
	-e PUID=$UID \
	-e PGID=$UID \
	-e TZ=Asia/Shanghai \
	--restart unless-stopped \
	awesometic/h5ai

echo "Start registry..."

if [ ! -d /data/registry ]; then
    sudo mkdir -p /data/registry
    sudo chown -R $USER. /data/registry
fi

docker run -d \
	-p 5000:5000 \
	-v /data/registry:/var/lib/registry \
	--restart always \
	--name registry \
	registry:2.7.1
